from keras.models import Sequential
from keras.layers import Dense

model = Sequential()
model.add(Dense(units=7, activation='relu', input_dim=1))
model.add(Dense(units=1, activation='sigmoid'))
model.compile(loss='mean_squared_error', optimizer='sgd')

x = [1, 2, 3, 4, 11, -2, -10, -100, -6, -20]
y = [1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0]
model.fit(x, y, epochs=10, batch_size=4)

test_x = [30, 40, -20, -66]
test_y = model.predict(test_x)

print(list(map(lambda x: "%.5f" % x, test_y)))
